<template>
  <footer class="footer">
    <span class="todo-count">剩余<strong>{{modCount}}</strong></span>
    <ul class="filters">
      <li>
        <a class="selected" href="javascript:;">全部</a>
      </li>
      <li>
        <a href="javascript:;">未完成</a>
      </li>
      <li>
        <a href="javascript:;">已完成</a>
      </li>
    </ul>
    <button class="clear-completed">清除已完成</button>
  </footer>
</template>

<script>
import { computed } from '@vue/runtime-core';
export default {
  props:['list'],
  computed:{
    modCount(){
      let count = 0
      this.list.forEach(element => {
        //代表找到未完成的，然后再让数量+1
        if(!element.isDone){
          count++
        }
      });
      return count
    }
  }
};
</script>